#pragma once
#include <QObject>
#include <QAudioOutput>
#include <QAudioFormat>
#include <QIODevice>

class AudioOutput : public QObject
{
    Q_OBJECT
public:
    explicit AudioOutput(QObject* parent = nullptr);
    ~AudioOutput();

    void start();
    void stop();

public slots:
    // 外部调用，用于播放数据
    void playData(const QByteArray& data);

private:
    QAudioOutput* m_audioOutput;
    QIODevice* m_outputDevice;
};
